import { Body, Controller, Get, Post, Put, Query, Param } from '@nestjs/common';
import { UserService } from './user.service';

@Controller('user')
export class UserController {
  constructor(private readonly userService: UserService) {}

  @Get('/:id')
  findOne(@Param('id') id: string) {
    return this.userService.findOne(id);
  }

  @Get()
  findAll() {
    return this.userService.findAll();
  }

  @Post()
  create(@Body() createDto: any) {
    return this.userService.create(createDto);
  }

  @Put()
  update(@Query('id') id: string, @Body() updataDot: any) {
    return this.userService.update(id, updataDot);
  }
}
